package com.example.yinweiapplication.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.yinweiapplication.R;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 1.heardView
 * 2.expanderableListView
 * 3.流式布局
 *
 *
 */
public class SearchFragment extends BaseFragment {

    private String url = "http://yinweiapi.paidui.com:81/jms/fetchData.do?procedureName=app_discover_index&parameters={\"_city_id\":\"00280001\"}&memberId=0" ;

    /**
     * heardView
     */

    private View view;
    private int[] imgId = {R.mipmap.fujin,R.mipmap.paihang,R.mipmap.daren};
    private String[] str = {"附近","排行","达人"};

    /**
     * expdableList
     */
    //父控件的
    private Map<String,Integer> map = new HashMap<>();
    private int[] groupImgId = {R.mipmap.caixi,R.mipmap.shicai,R.mipmap.kouwei};
    private List<String> text =new ArrayList<>();
    //子控件的
    private List<List<String>> datas =new ArrayList<>();


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view =inflater.inflate(R.layout.search_fragment_layout,null);
        loadData();
        initView();
        return view;
    }

    private void initView() {

    }

    private void loadData(){
        HttpUtils httpUtils = new HttpUtils();
        httpUtils.send(HttpRequest.HttpMethod.GET, url, new RequestCallBack<String>() {
            @Override
            public void onSuccess(ResponseInfo<String> responseInfo) {
                String str = responseInfo.result;
            }

            @Override
            public void onFailure(HttpException e, String s) {

            }
        });
    }
}
